package com.cauli.file.model.dto.file;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author Cauli
 * @date 2023-03-18 12:00
 * @description 创建文件DTO
 */
@Data
@ApiModel(value = "CreateFileDTO", description = "创建文件DTO")
public class CreateFileDTO {
    @ApiModelProperty("文件路径")
    private String filePath;

    @NotBlank(message = "文件名不能为空")
    @Pattern(regexp = "^[^\\\\/:*?\"<>|]{1,255}$", message = "文件名不合法！", flags = {Pattern.Flag.CASE_INSENSITIVE})
    @ApiModelProperty("文件名")
    private String fileName;

    @ApiModelProperty("扩展名")
    private String extendName;
}
